package com.hnust.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class IsEmail {
    //判断邮箱格式是否正确
    public static boolean JudgeEmail(String email) {
        Pattern emailPattern = Pattern.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
        Matcher matcher = emailPattern.matcher(email);
        if(matcher.find()){
            return true;
        }
        return false;
    }
}
